package cn.edu.ustc.xrovers.action;

import cn.edu.ustc.xrovers.dto.PageBean;
import cn.edu.ustc.xrovers.service.BaseService;
import cn.edu.ustc.xrovers.service.PaginationService;
import com.opensymphony.xwork2.ActionSupport;

public class LoanStatusPaginationAction extends ActionSupport{
	
	private static final int PAGESIZE=10;
	private int currentPage;
	private PageBean page;
	private PaginationService pagination;
	private BaseService bs;
	private String status;
	private String title;//
	
	
	/**
	 * 按照贷款状态查询贷款的分页支持
	 * @return
	 * @throws Exception
	 */
	public String findLoanByStatus() throws Exception {
		String hql=bs.getLoanHql(status);
		page=pagination.queryForPage(hql, PAGESIZE, currentPage);
		return "loanStatus";
	}

	/*getset方法*/
	public void setPagination(PaginationService pagination) {
		this.pagination = pagination;
	}

	public PaginationService getPagination() {
		return pagination;
	}

	public void setPage(PageBean page) {
		this.page = page;
	}

	public PageBean getPage() {
		return page;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setBs(BaseService bs) {
		this.bs = bs;
	}

	public BaseService getBs() {
		return bs;
	}

	public void setStatus(String status) {
		this.status= status;
	}

	public String getStatus() {
		return status;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}
}
